package com.xique.client.api;

import com.xique.client.api.factory.RemoteClientLogFallbackFactory;
import com.xique.common.core.constant.ServiceNameConstants;
import com.xique.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author shd
 * @create 2021/7/20 16:12
 */
@FeignClient(contextId = "remoteClientLogService", value = ServiceNameConstants.CLIENT_BIZ_SERVICE, fallbackFactory = RemoteClientLogFallbackFactory.class)
public interface RemoteClientLogService {

    /**
     * 保存访问记录
     *
     * @param clientId 岗亭ID
     * @param username 用户名称
     * @param status 状态
     * @param message 消息
     * @return 结果
     */
    @PostMapping("loginInfo")
    R<Boolean> saveClientLogininfor(@RequestParam("clientId") Long clientId, @RequestParam("username") String username, @RequestParam("status") String status,
                              @RequestParam("message") String message);

    /**
     * 删除岗亭登录用户信息
     * @author shd
     * @date 2021/7/30 17:12
     * @param clientId
     * @return com.xique.common.core.domain.R<java.lang.Boolean>
     */
    @PostMapping("loginOut/deleteUserInfo")
    R<Boolean> deleteClientUserInfo(@RequestParam("clientId") Long clientId);
}
